<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>意达设计</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="../css/member.css"/>

</head>
<body class="body bodyBG">

<!-- header -->
<div class="searchHeader foleth">
	<a href="javascript:void(0);" onclick="api.closeWin();"></a>
	<input type="text" id="key" placeholder="请输入搜索内容">
    <a href="javascript:void(0)" class="searchlink">搜索</a>
</div>

<div class="hr hrBG1 hrMargin"></div>

<!-- contact -->
<div class="bagnav">
	<div class="swiper-container bagnavheight">
        <div class="swiper-wrapper" id='cate'>
            <div class="swiper-slide"><a class="slideOn" href="javascript:void(0)">男包</a></div>
            <div class="swiper-slide"><a href="javascript:void(0)">女包</a></div>
            <div class="swiper-slide"><a href="javascript:void(0)">箱包</a></div>
            <div class="swiper-slide"><a href="javascript:void(0)">双肩包</a></div>
            
        </div>
    </div>
</div>
<div class="bagCont">
	<div class="bangimg"><img src="../image/page/img-005.jpg" id="bangimg" style="width:224.4px;height: 95.5px;"></div>
	<div class="bagtop"><span>热门品牌</span></div>
	<div class="baglt">
		<ul id='brand'>
			<li>
				<a href="#"><img src="../image/page/img-006.jpg"></a>
				<p>波仕龍</p>
			</li>
			<li>
				<a href="#"><img src="../image/page/img-007.jpg"></a>
				<p>MASLOU</p>
			</li>
			
		</ul>
	</div>
	<div class="hr hrBG2"></div>
	<div class="bagtop"><span id='catename'>热门推荐</span></div>
	<div class="baglt bagltToo">
		<ul id='son'>
			<li>
				<a href="#"><img src="../image/page/img-011.jpg"></a>
				<p>波仕龍</p>
			</li>
			<li>
				<a href="#"><img src="../image/page/img-012.jpg"></a>
				<p>MASLOU</p>
			</li>
			
		</ul>
	</div>
</div>
<div class="feashu"></div>

</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../script/adaptive.js"></script>
<script type="text/javascript" src="../script/swiper.min.js"></script>
<script type="text/javascript" src="../script/tabs.js"></script>
<script type="text/javascript">
    window['adaptive'].desinWidth = 750;
    window['adaptive'].baseFont = 28;
    window['adaptive'].maxWidth = 750;
    window['adaptive'].init();
    var swiperBanner = new Swiper('.swiper-container', {
            speed:400,
			freeMode: true,
            slidesPerView: 'auto',
			direction: 'vertical',
        });

    var first=0;
    var cname='';

    apiready = function () {
        $api.fixStatusBar($api.dom('.header'));
        api.addEventListener({
            name: 'keyback'
        }, function(ret, err){
            api.closeWidget();
        });
        api. addEventListener({name:'scrolltobottom'}, function(ret, err){
            //refresh event callback
            //toDoRequest();

        });
        api.showProgress();

        var para=api.pageParam;

        api.ajax({
            url: webSiteUrl+'/app/public/catead',
            method: 'post',
            data: {
                
              
            }
        }, function(ret, err) {
            api.hideProgress();
            if(ret.code==200){
                
                $('#bangimg').attr('src',webSiteUrl+ret.data.icon);


               cate();

            }

        });
    };

    $('.searchlink').click(function(){
        var key=$('#key').val();
        if(key==""){
            alert('请输入搜索内容');return;
        }
        searchPlay(key);
    })    
    function cate(){
        api.ajax({
            url: webSiteUrl+'/app/public/cate',
            method: 'post',
            data: {
                
               
            }
        }, function(ret, err) {
            api.hideProgress();
            
            if(ret.code==200){
                
               var tj=ret.data;

                //first=tj[0].id;


                html = "";
                for(var i=0;i<tj.length;i++){
                    html+='<div class="swiper-slide" id="s_'+tj[i].id+'" onclick="soncate('+tj[i].id+')">';
                    if(i==0){
                        html+='<a class="slideOn">'+tj[i].name+'</a></div>';
                    }else{
                        html+='<a>'+tj[i].name+'</a></div>';                
                    }

                }
                $('#cate').html(html);

                soncate(parseInt(tj[0].id));

            }else{alert(ret.msg)}
        });

    }
   

    function soncate(id){

        $("#s_"+id).find('a').addClass('slideOn');
        $("#s_"+id).siblings().find('a').removeClass('slideOn');

        //$('#catename').html("精品"+name);

        var p= {id:id};

        api.ajax({
            url: webSiteUrl+'/app/public/soncate',
            method: 'post',
            data: {
                
                values: p
            }
        }, function(ret, err) {
            api.hideProgress();
            
            if(ret.code==200){
                
               var tj=ret.data;
                html = "";
                for(var i=0;i<tj.length;i++){
html+= '<li onclick="morePlay('+1+','+tj[i].id+')"><a href="javascript:void(0);"><img src="'+webSiteUrl+tj[i].icon+'" style="width:60.5px;height:47.5px;"></a><p>'+tj[i].name+'</p></li>';
                }
                $('#son').html(html);

                brand(id);

            }else{alert(ret.msg)}
        });
    }

    function brand(id){
        var p= {id:id};
        api.ajax({
            url: webSiteUrl+'/app/public/brand',
            method: 'post',
            data: {
                
                values: p
            }
        }, function(ret, err) {
            api.hideProgress();
            
            if(ret.code==200){
              
               var tj=ret.data;
                html = "";
                for(var i=0;i<tj.length;i++){
html+='<li onclick="morePlay('+2+','+tj[i].id+')"><a href="javascript:void(0);"><img src="'+webSiteUrl+tj[i].icon+'" style="width:65.3px;height:44.5px;"></a><p>'+tj[i].name+'</p></li>';
                }
                $('#brand').html(html);



            }else{}
        });


    }


</script>

</html>
